Better PHP Development by Bruno Skvorc & Thomas Punt & Younes Rafie & Christopher Pitt & Reza Lavaryan

Better PHP Development by Bruno Skvorc & Thomas Punt & Younes Rafie & Christopher Pitt & Reza Lavaryan

Author:Bruno Skvorc & Thomas Punt & Younes Rafie & Christopher Pitt & Reza Lavaryan [Skvorc, Bruno]
Language: eng
Format: mobi
Publisher: SitePoint
Published: 2017-08-16T04:00:00+00:00


/**

* @Bean

* @return \Symfony\Component\EventDispatcher\EventDispatcher

*/

public function dispatcher()

{

$dispatcher = new \Symfony\Component\EventDispatcher\EventDispatcher();

$dispatcher->addSubscriber($this->listenerRouter());

return $dispatcher;

}

/**

* @Bean

* @return Kernel

*/

public function framework()

{

return new Kernel($this->dispatcher(), $this->resolver());

}

}

Seems like a lot of code; but in fact, it's the same code that resided in the front controller previously.

Before using the class, we need to make sure it has been autoloaded by adding it under the files key in our composer.json file:

// ...

"autoload": {

"psr-4": {

"": "src/"

},

"files": [

"src/Services.php"

]

}

// ...



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.